/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

package br.ufrj.dcc.comp2.projeto.controles;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import br.ufrj.dcc.comp2.projeto.modelos.Alienigena;
import br.ufrj.dcc.comp2.projeto.modelos.Nave;
import br.ufrj.dcc.comp2.projeto.modelos.Tiro;
import br.ufrj.dcc.comp2.projeto.modelos.Vetor2D;

/**
 * Controla lista dos componentes do jogo. Se o jogo esta pausado. E quantidade m�xima de tiros/alieniginas que podem haver na tela ao mesmo tempo.
 * @author Bruno(Magoo), Eluan(Acre), Diego(Silvio), Davi.
 *
 */
public class ControlaJogo {
	
	private Nave nave;
	private List<Tiro> tiros;
	private List<Alienigena> alienigenas;
	private List<Tiro> alienigenasTiros;
	private final Vetor2D tamanhoTela;
	private final int maxAlienigenas;
	private final int maxTiros;
	private boolean pausado;

	public ControlaJogo(Vetor2D tamanhoTela, int maxAlienigenas, int maxTiros) {
		this.nave = new Nave(new Vetor2D((int)tamanhoTela.getX()/2,(int)tamanhoTela.getY()),"resources/nave.png");
		this.nave.getPosicao().addY(-(nave.getTamanho().getY()*2));
		this.tiros = Collections.synchronizedList(new ArrayList<Tiro>());
		this.alienigenas = Collections.synchronizedList(new ArrayList<Alienigena>());
		this.alienigenasTiros = Collections.synchronizedList(new ArrayList<Tiro>());
		this.tamanhoTela = tamanhoTela;
		this.maxAlienigenas = maxAlienigenas;
		this.maxTiros = maxTiros;
	}
	
	public Nave getNave(){
		return this.nave;
	}
	
	public List<Tiro> getTiros(){
		return this.tiros;
	}
	
	public List<Alienigena> getAlienigenas(){
		return this.alienigenas;
	}
	
	public List<Tiro> getAlienigenasTiros(){
		return this.alienigenasTiros;
	}
	
	public Vetor2D getTamanhoTela() {
		return tamanhoTela;
	}
	
	public int getMaxAlienigenas() {
		return maxAlienigenas;
	}

	public int getMaxTiros() {
		return maxTiros;
	}
	
	public void setPausado(boolean pausa) {
		this.pausado = pausa;
	}
	
	public boolean isPausado() {
		return this.pausado;
	}
}
